﻿//*****************************************************************************
//** Project:PatternWell.PAC
//** Copyright 2011 PatternWell LLC
//** Revision History:
//** Version 1.0 - Initial Release
//*****************************************************************************
using System;

namespace PatternWell.PAC
{
    /// <summary>
    /// Attribute that stores the information about the type of child PAC that is supported by the target controller. 
    /// It also determines if the controller support a single or multiple child PAC's
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class ChildPAC : Attribute
    {
        /// <summary>
        /// Constructor for the attribute
        /// </summary>
        /// <param name="contract">The child PAC's contract to subscribe to.</param>
        /// <param name="singlePAC">Boolean flag that determines if the hosting controller manages more then one child PAC.</param>
        public ChildPAC(Type contract, bool singlePAC = true)
        {
            Contract = contract;
            SinglePAC = singlePAC;
        }

        /// <summary>
        /// Property that stores the type of model contract to be implemented on the model.
        /// </summary>
        public Type Contract { get; private set; }

        /// <summary>
        /// Boolean flag that determines if the hosting controller manages more then one child PAC
        /// </summary>
        public bool SinglePAC { get; private set; }

    }
}
